#!/bin/bash

num=$1
[ -z "$num" ] && num=10000
echo $num $[ ( $RANDOM % $num + 1 ) * 2 ] #> /tmp/data.txt
for i in `eval echo {1..$num}`; do
    lc=$[ $i * 2 ]
    if [ $lc -gt $num ]; then
        break
    fi
    echo $i $lc $[ $RANDOM % 1000  + 1 ]
    rc=$[ $lc + 1 ]
    if [ $rc -gt $num ]; then
        break
    fi
    echo $i $rc $[ $RANDOM % 1000  + 1 ]
done #>>  /tmp/data.txt
echo 0 0 #>> /tmp/data.txt

